In the mathematical field of numerical analysis, spline interpolation is a form of interpolation where the interpolant is a special type of piecewise polynomial called a spline. Spline interpolation is preferred over polynomial interpolation because the interpolation error can be made small even when using low degree polynomials for the spline. Spline interpolation avoids the problem of Runge's phenomenon which occurs when interpolating between equidistant points with high degree polynomials.
Contents |
Elastic rulers that were bent to pass through a number of predefined points (the "knots") were used for making technical drawings for shipbuilding and construction by hand, as illustrated by figure 1.
The approach to mathematically model the shape of such elastic rulers fixed by n+1 "knots" is to interpolate between all the pairs of "knots" and with polynomials
The curvature of a curve
is
As the elastic ruler will take a shape that minimizes the bending under the constraint of passing through all "knots" both and will be continuous everywhere, also at the "knots". To achieve this one must have that
and that
for all i , . This can only be achieved if polynomials of degree 3 or higher are used. The classical approach is to use polynomials of degree 3, this is the case of "Cubic splines".
A third order polynomial for which
can be written in the symmetrical form
|
( |
where
|
( |
and
|
( |
|
( |
As one gets that
|
( |
|
( |
Setting and in (5) and (6) one gets from (2) that indeed , and that
|
( |
|
( |
If now
are n+1 points and
|
( |
where
are n third degree polynomials interpolating in the interval , for such that
for
then the n polynomials together define a derivable function in the interval and
|
( |
|
( |
for where
|
( |
|
( |
|
( |
If the sequence is such that in addition
for
the resulting function will even have a continuous second derivative.
From (7), (8), (10) and (11) follows that this is the case if and only if
|
( |
for
The relations (15) are n-1 linear equations for the n+1 values .
For the elastic rulers being the model for the spline interpolation one has that to the left of the left-most "knot" and to the right of the right-most "knot" the ruler can move freely and will therefore take the form of a straight line with . As should be a continuous function of one gets that for "Natural Splines" one in addition to the n-1 linear equations (15) should have that
i.e. that
|
( |
|
( |
(15) together with (16) and (17) constitute n+1 linear equations that uniquely define the n+1 parameters
In case of three points the values for are found by solving the linear equation system
with
For the three points
one gets that
In figure 2 the spline function consisting of the two cubic polynomials and given by (9) is displayed